﻿@model ShivamEMR.Model.Domain.PatientDomain.Patient
@{
    ViewBag.Title = "Create";
    Layout = "~/Views/Shared/_UpdateLayout.cshtml";
}

<script src="@Url.Content("~/Scripts/Demo.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/uploadImage/uploadify.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Content/uploadImage/jquery.uploadify-3.1.min.js")" type="text/javascript"></script>

@section CustomHeader
{
    
}

 @*<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/uploadImage/uploadify.css")" rel="stylesheet" type="text/css" />
<script src="@Url.Content("~/Content/uploadImage/jquery.uploadify-3.1.min.js")" type="text/javascript"></script>*@
<script type="text/javascript">
    $(window).load(   
    function () {
        $("#ImageContainer").uploadify({
            'swf': '@Url.Content("~/Content/uploadImage/uploadify.swf")',
            'uploader': '/Patient/patient/Upload',
            'onUploadSuccess': function (file, data, response) {
                $("#UploadedImage").hide("fast").attr("src", "/Uploads/" + file.name).show("slow");
                $("#Picture").attr("value", file.name);                
            },
            'onUploadError': function (file, errorCode, errorMsg, errorString) {
                alert('The file ' + file.name + ' could not be uploaded: ' + errorString);
            }
        });


    }
);
</script>

 <script type="text/javascript">
     $(document).ready(function () {
         $("#tabs").tabs();
     });    
	</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
   <div id="tabs">
	    <ul>
		    <li><a href="#tabs-1">Basic </a></li>
		    <li><a href="#tabs-2">Picture</a></li>
		    <li><a href="#tabs-3">Contact</a></li>
               <li><a href="#tabs-4">Address</a></li>
		    <li><a href="#tabs-5">Medical</a></li>
		    <li><a href="#tabs-6">Representative</a></li>
	    </ul>
	    <div id="tabs-1">
            <table width="100%" cellpadding="4" cellspacing="4">
          
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Title)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.Title)
                            @Html.ValidationMessageFor(model => model.Title)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.FirstName, " First Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.FirstName)
                            @Html.ValidationMessageFor(model => model.FirstName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.MiddleName, " Middle Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.MiddleName)
                            @Html.ValidationMessageFor(model => model.MiddleName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.LastName, " Last Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.LastName)
                            @Html.ValidationMessageFor(model => model.LastName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltFirstName, " Alt First Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltFirstName)
                            @Html.ValidationMessageFor(model => model.AltFirstName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltMiddleName, " Alt Middle Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltMiddleName)
                            @Html.ValidationMessageFor(model => model.AltMiddleName)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.AltLastName, " Alt Last Name ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.AltLastName)
                            @Html.ValidationMessageFor(model => model.AltLastName)
                        </div>
                    </td>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.DateOfBirth, " Date of Birth ")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.DateOfBirth)
                            @Html.ValidationMessageFor(model => model.DateOfBirth)
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Sex )
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.SexID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.Sex>)ViewBag.PossibleSexes).Select(option => new SelectListItem
                       {
                           Text = Html.DisplayTextFor(_ => option.SexName).ToString(),
                           Value = option.ID.ToString(),
                           Selected = (Model != null) && (option.ID == Model.SexID)
                       }), "Choose...")
                            @Html.ValidationMessageFor(model => model.SexID)
                        </div>
                    </td>


                     <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.MaritalStatus, " Marital Status")
                        </div>
                    </td>
                     <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.MaritalSatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.MaritalStatus>)ViewBag.PossibleMaritalStatus).Select(option => new SelectListItem
                       {
                           Text = Html.DisplayTextFor(_ => option.Status).ToString(),
                           Value = option.ID.ToString(),
                           Selected = (Model != null) && (option.ID == Model.MaritalSatusID)
                       }), "Choose...")
                            @Html.ValidationMessageFor(model => model.MaritalSatusID)
                        </div>
                    </td>

                </tr>
                <tr>
                   
                     <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.RegisteredInBranch," Register In Branch")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.RegisteredInBranchID, ((IEnumerable<ShivamEMR.Model.Domain.CompanyDomain.Branch>)ViewBag.PossibleRegisteredInBranches).Select(option => new SelectListItem
                       {
                           Text = (option == null ? "None" : option.Name),
                           Value = option.ID.ToString(),
                           Selected = (Model != null) && (option.ID == Model.RegisteredInBranchID)
                       }), "Choose...")
                            @Html.ValidationMessageFor(model => model.RegisteredInBranchID)
                        </div>
                    </td>

                      <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.RegistrationDate,"Date of Registration")
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.EditorFor(model => model.RegistrationDate)
                            @Html.ValidationMessageFor(model => model.RegistrationDate)
                        </div>
                    </td>

                 @*   <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.PersonStatus)
                        </div>
                    </td>
                    <td>
                        <div class="editor-field">
                            @Html.DropDownListFor(model => model.PersonStatusID, ((IEnumerable<ShivamEMR.Model.Domain.PersonDomain.PersonStatus>)ViewBag.PossiblePersonStatus).Select(option => new SelectListItem
                       {
                           Text = Html.DisplayTextFor(_ => option.Status).ToString(),
                           Value = option.ID.ToString(),
                           Selected = (Model != null) && (option.ID == Model.PersonStatusID)
                       }), "Choose...")
                            @Html.ValidationMessageFor(model => model.PersonStatusID)
                        </div>
                    </td>*@
                    @*<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PictureID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PictureID)
            @Html.ValidationMessageFor(model => model.PictureID)
        </div>
</td>*@
                </tr>
                <tr>
                </tr>
            </table>
        </div>
         <div id="tabs-2">
           
            <table width="100%" cellpadding="4" cellspacing="4">
                <tr>
                  
                  
                </tr>
                <tr>
                    <td>
                    </td>
                    @*<td>

        <div class="editor-label">
            @Html.LabelFor(model => model.PersonAccountID)
        </div>
</td>
<td>

        <div class="editor-field">
            @Html.EditorFor(model => model.PersonAccountID)
            @Html.ValidationMessageFor(model => model.PersonAccountID)
        </div>
</td>*@
                </tr>
                <tr>
                    <td>
                        <div class="editor-label">
                            @Html.LabelFor(model => model.Picture)
                            @Html.HiddenFor(model => model.Picture.Title)
                        </div>
                    </td>
                    <td>
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td> <img id="UploadedImage" src="@Model.Picture" width="200px" height="130px" />
                                </td>
                            </tr>
                            <tr>
                             <td>
                        <div id="ImageContainer">
                        </div>
                             </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </div>

         <div id="tabs-3">
            @Html.Partial("PatientContacts", Model)  
           </div>

                
           <div id="tabs-4">
         @Html.Partial("PatientAddress", Model)  
          </div>

           <div id="tabs-5">
         @Html.Partial("PatientInformation", Model)  
          </div>
         

               <div id="tabs-6">
           @Html.Partial("Representatives", Model)  
                </div>


    </div>
    
    <input type="submit" value="Create" />

    
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script>
    $(function () {
        $("div.metro-pivot").metroPivot();
    });
</script>



